package com.robot.utils;

import cn.hutool.core.util.StrUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:TODO
 * @author:qzg
 * @Date:2021-02-01 11:07
 */
public class ListUtil {

    public static List<Long> toLongList(String value,String regex){
        List<Long> longList = new ArrayList<>();
        if(StrUtil.isNotEmpty(value)){
            String [] strings = value.split(regex);
            for(String s : strings){
                longList.add(Long.valueOf(s));
            }
        }
        return longList;
    }

    public static List<String> toStrlist(String value,String regex){
        List<String> strings = new ArrayList<>();
        if(StrUtil.isNotEmpty(value)){
            String [] split = value.split(regex);
            for(String s : split){
                strings.add(s);
            }
        }
        return strings;
    }
}
